package com.woniu.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniu.entity.RelUserTask;
import com.woniu.service.RelUserTaskService;
import com.woniu.mapper.RelUserTaskMapper;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
* @author nanqiao
* @description 针对表【rel_user_task】的数据库操作Service实现
* @createDate 2025-06-17 10:25:31
*/
@Service
public class RelUserTaskServiceImpl extends ServiceImpl<RelUserTaskMapper, RelUserTask>
    implements RelUserTaskService{
    @Override
    public void saveBatchByTaskId(Integer taskId, List<Integer> userIds) {
        List<RelUserTask> list = new ArrayList<>();
        for (Integer userId : userIds) {
            RelUserTask relUserTask = new RelUserTask();
            relUserTask.setUserId(userId);
            relUserTask.setTaskId(taskId);
            list.add(relUserTask);
        }
        this.saveBatch(list);
    }
}




